<!--
* Description: 日志详细预览页
* Company: 联宝（合肥）电子科技有限公司
* Author: Dongxu.Ni
* Date: 2020/3/9 18:40
-->

<template>
  <div v-loading="isRequesting">
    <div>{{ $t('Logger.logRequest') }}</div>
    <div>{{ detailData.requestMessage }}</div>
    <div>{{ $t('Logger.logResponse') }}</div>
    <div>{{ detailData.responseMessage }}</div>
  </div>
</template>

<script>
import { logQueryMsgDetail } from '../../../../api/sys/log'

export default {
  name: 'LogDetail',
  props: {
    inputData: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  data() {
    return {
      isRequesting: false,
      detailData: {
        requestMessage: '',
        responseMessage: ''
      }
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    this.pageInit()
  },
  methods: {
    async pageInit() {
      try {
        this.isRequesting = true
        const response = await logQueryMsgDetail({ logId: this.inputData.logId })
        this.detailData.requestMessage = response.data.requestMessage
        this.detailData.responseMessage = response.data.responseMessage
      } catch (error) {
        console.log(error)
      } finally {
        this.isRequesting = false
      }
    }
  }
}
</script>

<style scoped></style>
